package cn.edu.scau.cmi.zenglinghong.client;

import org.springframework.context.ApplicationContext;

import cn.edu.scau.cmi.zenglinghong.spring.domain.Student;
import cn.edu.scau.cmi.zenglinghong.spring.domain.Teacher;
import cn.edu.scau.cmi.zenglinghong.spring.util.ApplicationContextUtil;

public class Spring01 {

	public static void main(String[] args) {
		ApplicationContext applicationContext = ApplicationContextUtil.getApplicationContext();
		Student zhangsan = (Student) applicationContext.getBean("zhangsan", Student.class);
		Teacher liangzaoqing = (Teacher) applicationContext.getBean("liangzaoqing", Teacher.class);
		System.out.println(zhangsan.getName() + "的毕业设计指导老师是:" + liangzaoqing.getName());
	}

}
